<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>购物车</title>
		<link rel="stylesheet" href="<?php echo __PUBLIC__?>/Home/less/buycar.css" />
		<link rel="stylesheet" href="<?php echo __PUBLIC__?>/Home/less/index.css" />
		<link rel="stylesheet" href="<?php echo __PUBLIC__?>/Home/less/bottom.css" />
		<link rel="stylesheet" href="<?php echo __PUBLIC__?>/Home/bootstrap/css/bootstrap.css" />
		<script src="<?php echo __PUBLIC__?>/Home/city/jquery-1.8.2.min.js"></script>
	</head>

	<body>
		<!--购物车头部-->
		<div id="carhead">
			
			<div class="carhead">
				<img src="<?php echo __PUBLIC__?>/Home/images/vancl-logo.png" alt="" />
				<div class="chright">
					<?php if((isset($_SESSION['username']))){?>
                
					<span class="welcome">您好,<a href=""><?php echo $_SESSION['username']?></a>!</span>
					<span class="login"style="width:140px;margin-left:-30px;">
						<a href="<?php echo U('Login/out')?>">退出登录</a>|<a href="<?php echo U('Login/index')?>">更换用户</a>
					</span>
                    <?php }else{?>
                    <span class="welcome">您好,欢迎光临凡客诚品!</span>
					<span class="login">
						<a href="<?php echo U('Login/index')?>">登陆</a>|<a href="<?php echo U('Register/index')?>">注册</a>
					</span>
					
               <?php }?>
					<span class='help'><a href="">帮助中心</a></span>
				</div>
			</div>

		</div>
	<!--第二版-->
	<div id="buycar">
		<!--上部状态切换-->
			<ul class="tul">
				<li class='llone'><span class="word">1.我的购物车</span> </li>
				<li class='lltwo'><span class="word">2.填写核对信息单</span></li>
				<li class='lthree'><span class="word">3.成功提交订单</span></li>
			</ul>
		<!--核对信息页面-->
			<div class="csecond">
				<!--左侧-->
				<div class="cstop">
					
					<div class="csleft">
					<li>收货地址：</li>
					<li>配送方式： </li>
					<li class='lend'>支付方式：</li>
					</div>
					<div class="csright">
						<li class='afirst'>
							<br />
							<br />
							<!--点击时变红并获得他的地址id-->
							<script type="text/javascript">
								$(function(){
									$('.afirst>.address').click(function(){
//										边框变红
										$(this).addClass('red').siblings().removeClass('red');
//										获得地址id/
										var a=$(this).attr('address');
										$.ajax({
											url:"<?php echo U('Success/index')?>",
											type:'post',
											data:{addid:a},
											dataType:'json',
											success:function(phpData){
												location.href("<?php echo U('Success/index')?>");
											}
										})
									})
								})
							</script>
							<?php foreach ($adddata as $v){?>
							<div class="address"address="<?php echo $v['addid']?>">
								
								<h4>收件人：<?php echo $v['name']?></h4>
								<p class="tel">
									联系方式：<?php echo $v['tel']?>
								</p>
								<!--地址-->
								<p class="site">
									地址：<?php echo $v['address']?>
								</p>
								<!--邮编-->
								<p class="postcode">
									邮编：<?php echo $v['code']?>
								</p>
								<!--<input type="text" name="addid"value="<?php echo $v['addid']?>" />-->
							</div>
							<?php }?>
							<br />
							<p><a href="<?php echo U('Address/add')?>"class='add'><span>+</span>添加新地址</a></p>
						</li>
						<li class='asecond'>
							<br />
							<br />
							<script type="text/javascript">
								$(function(){
									$('.asecond>.time').click(function(){
//										alert(2);
										$(this).addClass('red').siblings().removeClass('red');
									})
								})
							</script>
							<a class="time">
								<p>周一至周五、工作日送货</p>
							</a>
							<a class="time">
								<p>周六、周日、假日送货</p>
							</a>
							<a class="time">
								<p>周一至周日、假日均可送货</p>
							</a>
							<div class="declare">
								<span class="sm">声明：</span>

	<p>1. 查看货到付款配送范围</p>
	<p>2. 送货时间：早 8:30至 晚7:30</p>
	<p>3. 我们会努力按照您选择的时间进行配送，但因天气、交通等因素影响，您的订单有可能会有延误现象，请您谅解！</p>



							</div>
						</li>
						<li class='end athree'>
							<br />
							<br />
							<script type="text/javascript">
								$(function(){
									$('.athree>.time').click(function(){
//										alert(2);
										$(this).addClass('red').siblings().removeClass('red');
									})
								})
							</script>
							<a class="time">
								<p>在线支付</p>
								<p><span> 所有支付方式</span></p>
							</a>
							<a class="time">
								<p> 货到付款 </p>
								<p> 现金</p>
							</a>
							<a class="time">
								<p> 货到付款 </p>
								<p> POS机刷卡</p>
							</a>
						</li>
					</div>
					<!--结算-->
					<table width="100%" cellpadding="0" cellspacing="0" class='paymoney'>
									<!-- 产品信息 -->
									<tr class='ttr'>
										<td >名称</td>
										<td >规格</td>
										<td >单价</td>
										<td >数量</td>
										<td >优惠</td>
										<td >小计</td>
									</tr>
									
									<!--第二排-->
									<?php foreach ($orderlist as $v){?>
									<tr class="retwo">

										<td width='250'><?php echo $v['name']?></td>
										
										<td width='150'>
										<?php foreach ($v['options'] as $vv){?>
										<?php echo $vv?>
										<?php }?>
										</td>
										<td width='150'><?php echo $v['price']?></td>
										<td width='125'><?php echo $v['num']?> </td>
										<td width='125'>-</td>
										<td width='350'style="color:#D05454"><?php echo $v['total']?></td>
									</tr>
									<?php }?>
									<tr>
										<td></td><td></td><td></td><td></td><td></td>

										<td style='width:400px;'>商品金额小计:<span class="jia"style="color:#D05454;font-size:20px;">￥<?php echo $_SESSION['cart']['total']?></span>   应付:<span class="jia"style="color:#D05454;font-size:20px;">￥<?php echo $_SESSION['cart']['total']?></span></td>
									</tr>
									
								</table>
								<p class="jiesuan">
									已支付：<span class='jia'>￥0.00</span>,您还需支付：<span class='jia'>￥49.00 </span>
								</p>
									<script>
										$(function(){
//											给提交单钮加一个单击事件
											$('.subtijiao').click(function(){
//												alert(1);
//												获得地址属性
										
											})
										})
									</script>
									<!--<a href="javascript:;" class='subtijiao sub btn btn-danger'>提交订单</a>-->
									<input type="submit" value="提交订单"class='subtijiao sub btn btn-danger' />
									
								
								
				</div>
				
				
			</div>
			<!--第二版结束-->
	</div>
			
			   
			 
			   
		</div>

		<!--结尾-->

		<!--底部-->
		<div id="bottom">
			<div class="bottom">
				<p>Copyright 2007 - 2015 vancl.com All Rights Reserved 京ICP证100557号 京公网安备11011502002400号 出版物经营许可证新出发京批字第直110138号</p>
				<ul>
					<li>
						<a href="" class='one'></a>
					</li>
					<li>
						<a href="" class='two'></a>
					</li>
					<li>
						<a href="" class='three'></a>
					</li>
					<li>
						<a href="" class='four'></a>
					</li>

					<li>
						<a href="" class='five'></a>
					</li>
					<li>
						<a href=""><img src="<?php echo __PUBLIC__?>/Home/images/kexin_brand_for_others.png" alt="" /></a>
					</li>

				</ul>
			</div>
		</div>
	</body>

</html>